/// <reference path="../_all.ts" />

module Application.Resources {
    export interface ITemplateClass extends ng.resource.IResourceClass {
    }

    export interface ITemplate extends ng.resource.IResource {
        template_id: number;
        server_id: number;
        file: string;
        destination: string;
        is_commandline: boolean;
        is_active: boolean;
        created_at: Date;
        updated_at: Date;
    }

    export class TemplateUtility {
        static fixBooleans(item: ITemplate) {
            item.is_commandline = Application.Utility.Booleans.parse(item.is_commandline);
            item.is_active = Application.Utility.Booleans.parse(item.is_active, true);
        }
    }
}